// 展示历史核酸检测情况
<template>
    <!-- TODO -->
    <el-table v-loading="loading" :data="nucleics" :default-sort="{ prop: 'time', order: 'descending' }" height="650px">
        <el-table-column prop="id" sortable label="编号" />
        <el-table-column prop="time" sortable label="时间" />
        <el-table-column prop="medical_point" label="机构" />
        <el-table-column prop="status" label="状态" />
    </el-table>
</template>

<script>
import { Request } from '../../utils/request'

export default {
    name: 'NucleicShow',
    data() {
        return {
            nucleics: [
                {
                    id: 1,
                    time: '2020-01-01',
                    medical_point: "浙江大学附属第一医院",
                    status: "阴性"
                },
                {
                    id: 1,
                    time: '2022-01-02',
                    medical_point: "浙江大学附属第2医院",
                    status: "阳性"
                },
            ],
            loading: false
        };
    },
    created() {
        //this.reload()
    },
    methods: {
        // TODO: fix api
        reload() {
            this.loading = true
            Request({
                url: '/nucleic-acid-test',
                method: 'get'
            }).then(res => {
                this.nucleics = res.record_list
                this.loading = false
                console.log(this.loading)
            })
        },
    }
}
</script>